<%@taglib prefix="s" uri="/struts-tags" %>
<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<head>
    <title><s:text name="groups"/></title>   
</head>

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/search.css"/>	
<div class="panelTitle"><s:text name="users"/></div>
<table id="resultsTable" class="completelyBordered searchTable">
	<tr>
		<th><s:text name="user"/></th>
		<th><s:text name="email"/></th>
		<th><s:text name="groups"/></th>
		<th><s:text name="actions"/></th>
	</tr>
	<s:iterator value="users" var="item" status="rowStatus">
		<tr class="${rowStatus.odd ? 'oddRow' : 'evenRow'}">
			<td class="nameCell ${item.enabled ? '' : 'disabledUser'}">
				${item.name}
			</td>
			<td class="nameCell ${item.enabled ? '' : 'disabledUser'}">
				${item.email}
			</td>
			<td class="${item.enabled ? '' : 'disabledUser'}">
				<s:iterator value="#item.groups" var="subitem">
					${subitem.name};
				</s:iterator>
			</td>
			<td class="${item.enabled ? '' : 'disabledUser'}" align="center" width="60px">
				<a href="SecurityEditUser?userName=${item.name}"><img alt="<s:text name="edit"/>" height="16" src="${pageContext.request.contextPath}/img/edit.png"/></a>
   				<a onclick="if(confirm('<s:text name='delete.confirmation.question'/>')) window.location.href='SecurityDeleteUser?userName=${item.name}'" href="#"><img alt="<s:text name="delete"/>" height="16" src="${pageContext.request.contextPath}/img/delete.png"/></a>
			</td>
		</tr>
	</s:iterator>
	<s:form action="SecurityEditUser">
		<s:submit id="submit" key="addNewUser"/>
	</s:form>
</table>
